<md-card>
    <table ng-if="settings" class="table">
        <tr>
            <th>Failback</th>
        </tr>
        <tr>
            <td>
                <md-switch ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" ng-true-value="true" ng-false-value="false" ng-model="selectedCluster.config.autorejoin"
                           ng-click="switchsettings('autorejoin')" aria-label="Auto Rejoin">
                    <span ng-if="selectedCluster.config.autorejoin" class="label label-primary">On</span><span
                        ng-if="!selectedCluster.config.autorejoin" class="label label-warning">Off</span>
            </td>
            </md-switch>
            </td>
        </tr>

        <tr>
            <th>Failback Backup Extra Events</th>
        </tr>
        <tr>
            <td>
                <md-switch ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" ng-true-value="true" ng-false-value="false"
                           ng-model="selectedCluster.config.autorejoinBackupBinlog"
                           ng-click="switchsettings('autorejoin-backup-binlog')" aria-label="Auto Rejoin">
                    <span ng-if="selectedCluster.config.autorejoinBackupBinlog"
                          class="label label-primary">On</span><span
                        ng-if="!selectedCluster.config.autorejoinBackupBinlog" class="label label-warning">Off</span>
            </td>
            </md-switch>
            </td>
        </tr>

        <tr>
            <th>Failback Fashback when Semi-sync status Sync</th>
        </tr>
        <tr>
            <td>
                <md-switch ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" ng-true-value="true" ng-false-value="false"
                           ng-model="selectedCluster.config.autorejoinFlashbackOnSync"
                           ng-click="switchsettings('autorejoin-flashback-on-sync')"
                           aria-label="Failback with binlog flashback only if semisync ">
                    <span ng-if="selectedCluster.config.autorejoinFlashbackOnSync" class="label label-primary">On</span><span
                        ng-if="!selectedCluster.config.autorejoinFlashbackOnSync" class="label label-warning">Off</span>
            </td>
            </md-switch>
            </td>
        </tr>

        <tr>
            <th>Failback Binlog Flashback</th>
        </tr>
        <tr>
            <td>
                <md-switch ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" ng-true-value="true" ng-false-value="false"
                           ng-model="selectedCluster.config.autorejoinFlashback"
                           ng-click="switchsettings('autorejoin-flashback')"
                           aria-label="Failback with binlog flashback">
                    <span ng-if="selectedCluster.config.autorejoinFlashback"
                          class="label label-primary">On</span><span
                        ng-if="!selectedCluster.config.autorejoinFlashback" class="label label-warning">Off</span>
            </td>
            </md-switch>
            </td>
        </tr>

        <tr>
            <th>Failback Direct Master Dump</th>
        </tr>
        <tr>
            <td>
                <md-switch ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" ng-true-value="true" ng-false-value="false" ng-model="selectedCluster.config.autorejoinMysqldump"
                           ng-click="switchsettings('autorejoin-mysqldump')"
                           aria-label="Auto rejoin with logical dump">
                    <span ng-if="selectedCluster.config.autorejoinMysqldump" class="label label-primary">On</span><span
                        ng-if="!selectedCluster.config.autorejoinMysqldump" class="label label-warning">Off</span>
            </td>
            </md-switch>
            </td>
        </tr>
        <tr>
            <th>Failback Via Logical Backup</th>
        </tr>
        <tr>
            <td>
                <md-switch ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" ng-true-value="true" ng-false-value="false" ng-model="selectedCluster.config.autorejoinLogicalBackup"
                           ng-click="switchsettings('autorejoin-logical-backup')"
                           aria-label="Auto rejoin with logical backup">
                    <span ng-if="selectedCluster.config.autorejoinLogicalBackup" class="label label-primary">On</span><span
                        ng-if="!selectedCluster.config.autorejoinLogicalBackup" class="label label-warning">Off</span>
            </td>
            </md-switch>
            </td>
        </tr>
        <tr>
            <th>Failback Via Physical Backup</th>
        </tr>
        <tr>
            <td>
                <md-switch ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" ng-true-value="true" ng-false-value="false" ng-model="selectedCluster.config.autorejoinPhysicalBackup"
                           ng-click="switchsettings('autorejoin-physical-backup')"
                           aria-label="Auto rejoin with logical backup">
                    <span ng-if="selectedCluster.config.autorejoinPhysicalBackup" class="label label-primary">On</span><span
                        ng-if="!selectedCluster.config.autorejoinPhysicalBackup" class="label label-warning">Off</span>
            </td>
            </md-switch>
            </td>
        </tr>
        <tr>
            <th>Force Rejoin With Restore</th>
        </tr>
        <tr>
            <td>
                <md-switch ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" ng-true-value="true" ng-false-value="false" ng-model="selectedCluster.config.autorejoinForceRestore"
                           ng-click="switchsettings('autorejoin-force-restore')"
                           aria-label="Auto rejoin force Restore">
                    <span ng-if="selectedCluster.config.autorejoinForceRestore" class="label label-primary">On</span><span
                        ng-if="!selectedCluster.config.autorejoinForceRestore" class="label label-warning">Off</span>
            </td>
            </md-switch>
            </td>
        </tr>
        <tr>
            <th>Auto seed from backup standalone server</th>
        </tr>
        <tr>
            <td>
                <md-switch ng-disabled="selectedCluster.apiUsers[user].grants['cluster-settings']==false" ng-true-value="true" ng-false-value="false" ng-model="selectedCluster.config.autoseed"
                           ng-click="switchsettings('autoseed')"
                           aria-label="Auto seed with backup">
                    <span ng-if="selectedCluster.config.autoseed" class="label label-primary">On</span><span
                        ng-if="!selectedCluster.config.autoseed" class="label label-warning">Off</span>
            </td>
            </md-switch>
            </td>
        </tr>
    </table>
</md-card>
